package cn.zhaoyuening.zamh.handler;

import cn.zhaoyuening.zamh.msg.Msg;

/**
 * Created by 赵岳宁 on 2017/6/3.
 * MsgHandler 负责异步处理消息，通过注册到{@link cn.zhaoyuening.zamh.manager.MsgManager}实现对消息的监听处理
 */
public abstract class MsgHandler {
    private final int msgId;


    public MsgHandler(int msgId) {
        this.msgId = msgId;
    }


    public int getMsgId() {
        return msgId;
    }

    /**
     * 处理一个消息
     * @param msg 被处理的消息
     */
    public abstract void handle(Msg msg);
}
